using System;

namespace raycsharp {

  public class PPM {
    private Color[,] image { get; set; }
    private uint width { get; set; }
    private uint height { get; set; }

    public PPM(Color[,] _image, uint _width, uint _height) {
      image = _image;
      width = _width;
      height = _height;
    }
    public void save(String path) {
      Console.WriteLine("P3");
      Console.WriteLine("# comment");
      Console.WriteLine(width + " " + height);
      Console.WriteLine("255");
      for(uint y = 0; y < height; y++) {
        for(uint x = 0; x < width; x++) {
          Console.WriteLine(image[x,y].red*255.0 + " " + image[x,y].green*255.0 + " " + image[x,y].blue*255.0);
          
        }
      }

    }

  }
}
